#include "../../client/rpc_client.hpp"

int main()
{
    MyRpc::client::TopicClinent::ptr publish_topic = std::make_shared<MyRpc::client::TopicClinent>("127.0.0.1", 8888);
    // 创建主题
    bool flag = publish_topic->create("music");
    if(flag == false)
    {
        LOG(DEBUGLEVEL, "创建主题失败!");
    }
    // 进行消息推送
    for(int i = 0; i < 10; i++)
    {
        std::string msg = "这是一首music--" + std::to_string(i);
        publish_topic->publish("music", msg);
    }
    
    std::this_thread::sleep_for(std::chrono::seconds(10));
    publish_topic->shutDown();
    return 0;
}